import { ElMessage, ElLoading } from "element-plus";

export default function useLoading() {
  const loading = ElLoading.service();
  setTimeout(() => {
    if (loading.visible.value) {
      loading.close();
      ElMessage.error("请求失败，请稍后重试");
    }
  }, 10 * 1000);
  return loading;
}
